package com.wingsoft.common.utils;

import java.math.BigDecimal;

/**
 *
 * @author fyadmin
 */
public class NumberUtils
{
    public static float Scale(float num,int fix)
    {
        BigDecimal b  =   new  BigDecimal(num);
        return b.setScale(fix,  BigDecimal.ROUND_HALF_UP).floatValue();
    }

    public static double Scale(double num,int fix)
    {
        BigDecimal b  =   new  BigDecimal(num);
        return b.setScale(fix,  BigDecimal.ROUND_HALF_UP).doubleValue();
    }
}
